home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Games of Daze
/
Infomagic - Games of Daze (Summer 1995) (Disc 1 of 2).iso
/
x2ftp
/
msdos
/
libs
/
pdcurs21
/
private
/
_sgetnl.c
< prev
next >
Wrap
C/C++ Source or Header
|
1993-06-18
|
2KB
|
86 lines
#define CURSES_LIBRARY 1
#include <curses.h>
#if BUG68K
#ifdef PDCDEBUG
char *rcsid__sgetnl = "$Header: C:\CURSES\private\RCS\_sgetnl.c 2.1 1993/06/18 20:23:50 MH Rel MH $";
#endif
void c_setnl( char* ); /* conv nl -> CTRL-\ */
void c_getnl( char* ); /* conv CTRL-\ -> nl */
/*man-start*********************************************************************
PDC_setnl() - BUG68K: set newline for 68000 C compiler
PDCurses Description:
This is a private PDCurses function.
This function circumvents a problem in the 68000 C library: If
the standard sprintf is used, it will ignore any newlines in
the format string. Therefore this routine changes the newlines
to CTRL-\ characters, to be restored later by the getnl()
function.
PDCurses Return Value:
This function does not return a value.
PDCurses Errors:
There are no defined errors for this routine.
Portability:
PDCurses void PDC_setnl( char* fmt ); /* BUG68K only */
**man-end**********************************************************************/
void PDC_setnl(char *fmt)
{
#ifdef PDCDEBUG
if (trace_on) PDC_debug("PDC_setnl() - called\n");
#endif
while (*fmt)
{
if (*fmt == '\n')
*fmt = 0x1c;
fmt++;
}
}
/*----------------------------------------------------------------------
$ PDC_getnl() - BUG68K: get newline for 68000 C compiler
$
$ PDCurses Description:
$ This is a private PDCurses function.
$
$ This function circumvents a problem in the 68000 C library: If
$ the standard sprintf is used, it will ignore any newlines in
$ the format string. Therefore this routine changes CTRL-\
$ characters (already set by setnl()) back to newlines.
$
$ PDCurses Return Value:
$ This function does not return a value.
$
$ PDCurses Errors:
$ There are no defined errors for this routine.
$
$ Portability:
$ PDCurses void PDC_getnl( char* fmt ); /* BUG68K only */
$
$----------------------------------------------------------------------
*/
void PDC_getnl(cahr *fmt)
{
#ifdef PDCDEBUG
if (trace_on) PDC_debug("PDC_getnl() - called\n");
#endif
while (*fmt)
{
if (*fmt == 0x1c)
*fmt = '\n';
}
}
#endif